package by.yakusekmaxim.bookgid.services;

import java.util.List;

import javax.persistence.metamodel.SingularAttribute;

import org.springframework.transaction.annotation.Transactional;

import by.yakusekmaxim.bookgid.dataaccess.util.Filter;
import by.yakusekmaxim.bookgid.datamodel.Author;

public interface AuthorService {

	Author get(Long id);

    @Transactional
    void saveOrUpdate(Author author);

    @Transactional
    void delete(Author author);

    @Transactional
    void deleteAll();
    
	@Transactional
	Long getCount();

	@Transactional
	Long getCount(SingularAttribute<Author, ?> attribute, Object value);
	
	@Transactional
    List<Author> getAll();
    
	@Transactional
	List<Author> getAllAuthor (SingularAttribute<Author, ?> attr,
			boolean ascending, int startRecord, int pageSize);

	@Transactional
	List<Author> getAllAuthor(SingularAttribute<Author, ?> attr,
			boolean ascending, int startRecord, int pageSize,
			Filter<Author> filter);

}
